#include<iostream>
#include <stdio.h>
#include"lapack.h"
#include"lapacke.h"
#include"lapacke_config.h"
#include"lapacke_utils.h"

using std::cout;
using std::cin;
using std::endl;

extern lapack_int LAPACKE_dgeev( int matrix_order, char jobvl, char jobvr, lapack_int n, double * a, 
lapack_int lda, double * wr,double * wi, double * vl, lapack_int ldvl, double * vr,lapack_int ldvr );

int main(int argc, char *argv[]){
    int n = 50;
    int i. j;
    double A[n][n];
    for(i = 0; i < n; i++){
        for(j = 0;j < n; j++){
            A[i][j] = 0;
        }
        A[i][i] = 2 * i + 1;
    }
    int matrix_order = LAPACK_COL_MAJOR;
    char jobvl = 'N' ;
    char jobvr = 'N' ;
    int lda = n;
    double wr[n] = { 0 };
    double wi[n] = { 0 };
    double vl[n * n];
    int ldvl = n ;
    double vr[n * n];
    int ldvr = n ;
    int info = LAPACKE_dgeev(matrix_order,jobvl,jobvr,n,*A,lda,wr,wi,vl,ldvl,vr,ldvr);
    FILE* fp;
    if (info == 0 ){
        i = 0 ;
        j = 0 ;
        fp = fopen("lapackresult.txt","w");
        for(i = 0 ;i < n;i ++ ){
            fprintf(fp, " %.6g + i %.6g \t " ,wr[i],wi[i]);
            fprintf(fp, " \n " );
        }
    }
    fclose(fp);

    return 0;
}
